package pers.xx.sbm.vo;

import pers.xx.sbm.entity.SuccessKilled;
import pers.xx.sbm.enums.SeckillStateEnum;

/**
 * @author ：xiexing
 * @description：封装秒杀执行后的结果
 * @date ：2020/7/22 21:21
 */
public class SeckillExecution {

    private long seckillId;//秒杀单号

    private int state;//秒杀状态值

    private String stateInfo;//秒杀信息

    private SuccessKilled successKilled;//秒杀成功对象

    public SeckillExecution(long seckillId, SeckillStateEnum seckillStateEnum, SuccessKilled successKIlled) {
        this.seckillId = seckillId;
        this.state = seckillStateEnum.getState();
        this.stateInfo = seckillStateEnum.getStateInfo();
        this.successKilled = successKIlled;
    }

    public SeckillExecution(long seckillId, SeckillStateEnum seckillStateEnum) {
        this.seckillId = seckillId;
        this.state = seckillStateEnum.getState();
        this.stateInfo = seckillStateEnum.getStateInfo();
    }


    public long getSeckillId() {
        return seckillId;
    }

    public void setSeckillId(long seckillId) {
        this.seckillId = seckillId;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public String getStateInfo() {
        return stateInfo;
    }

    public void setStateInfo(String stateInfo) {
        this.stateInfo = stateInfo;
    }

    public SuccessKilled getSuccessKIlled() {
        return successKilled;
    }

    public void setSuccessKIlled(SuccessKilled successKIlled) {
        this.successKilled = successKIlled;
    }

    @Override
    public String toString() {
        return "SeckillExecution{" +
                "seckillId=" + seckillId +
                ", state=" + state +
                ", stateInfo='" + stateInfo + '\'' +
                ", successKilled=" + successKilled +
                '}';
    }
}
